﻿<AttributeUsage(AttributeTargets.Property, Inherited:=False, AllowMultiple:=False)> _
Public NotInheritable Class LookupAttribute
    Inherits Attribute

    Private _tableName As String

    Public ReadOnly Property TableName As String
        Get
            Return _tableName
        End Get
    End Property

    Public Sub New(ByVal targetEntity As Type)

        ' Ensure the type passed in is of the correct type
        If targetEntity.BaseType Is Nothing OrElse targetEntity.BaseType IsNot GetType(BaseEntity) Then
            Throw New ArgumentException("The type must be a type that extends BaseEntity.", "targetEntity")
        End If

        ' Set variables
        Me._tableName = targetEntity.Name

    End Sub

End Class

